﻿@* Generator: Template *@
@functions { public dynamic Model { get; set; } }@{
    var dotModule = Model.Module == null ? "" : ("." + Model.Module);
    var moduleDot = Model.Module == null ? "" : (Model.Module + ".");

    Func<EntityField, string> gt = (f) => {
        if (f.FieldType == "String") {
            return "StringEditor";
        }
        else if (f.FieldType == "Int32" || f.FieldType == "Int16" || f.FieldType == "Int64") {
            return "IntegerEditor";
        }
        else if (f.FieldType == "Single" || f.FieldType == "Double" || f.FieldType == "Decimal") {
            return "DecimalEditor";
        }
        else if (f.FieldType == "DateTime") {
            return "DateEditor";
        }
        else if (f.FieldType == "Boolean") {
            return "BooleanEditor";
        }
        else
            return "StringEditor";
    };
}
using jQueryApi;
using Serenity;
using Serenity.ComponentModel;
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Runtime.CompilerServices;

namespace @(Model.RootNamespace)@(dotModule)
{
    public partial class @(Model.ClassName)Form : PrefixedContext
    {
        [InlineConstant] public const string FormKey = "@(moduleDot)@(Model.ClassName)";

        public @(Model.ClassName)Form(string idPrefix) : base(idPrefix) {}

@foreach (EntityField x in Model.Fields)
    {
        if (x.Ident != Model.Identity)
        {<text>
        public @(gt(x)) @x.Ident { [InlineCode("{this}.w('@(x.Ident)', Serenity.@(gt(x)))")] get; private set; }</text>}
    }

    }
}